// ignore_for_file: prefer_final_fields

import 'package:get/get.dart';
import 'package:fortune_app/app/app_views.dart';

/// 路由配置 - Route configuration
abstract class AppPages {
  static final pages = [
    GetPage(
      name: Routes.SPLASH,
      page: () => const SplashView(),
      binding: BindingsBuilder(() {
        if (!Get.isRegistered<SplashLogic>()) {
          Get.put(SplashLogic());
        }
      }),
    ),
    GetPage(
      name: Routes.ROOT,
      page: () => const RootView(),
      binding: BindingsBuilder(() {
        Get.put(RootLogic());
        Get.put(ToolsLogic());
        Get.put(AnalysisLogic());
        Get.put(ClassroomLogic());
        Get.put(ProfileLogic());
      }),
    ),
    GetPage(
      name: Routes.LOGIN,
      page: () => const LoginView(),
      binding: BindingsBuilder(() {
        Get.lazyPut(() => AuthLogic());
      }),
    ),
    GetPage(
      name: Routes.REGISTER,
      page: () => const RegisterView(),
      binding: BindingsBuilder(() {
        Get.lazyPut(() => AuthLogic());
      }),
    ),
    GetPage(
      name: Routes.HOME,
      page: () => const HomeView(),
      binding: BindingsBuilder(() {
        Get.lazyPut(() => HomeLogic());
      }),
    ),
    GetPage(
      name: Routes.CALENDAR,
      page: () => const CalendarView(),
      binding: BindingsBuilder(() {
        Get.lazyPut(() => CalendarLogic());
      }),
    ),
    GetPage(
      name: Routes.STORE,
      page: () => const StoreView(),
      binding: BindingsBuilder(() {
        Get.lazyPut(() => StoreLogic());
      }),
    ),
    // GetPage(
    //   name: Routes.BAZIXUANZE,
    //   page: () => BaziXuanzePage(),
    // ),
    // GetPage(
    //   name: Routes.PICKERUTILS,
    //   page: () => PickerController(),
    // ),
  ];
}

/// 命名路由 - Named routes
abstract class Routes {
  static const INITIAL = '/';
  static const SPLASH = '/splash';
  static const ROOT = '/root';
  static const LOGIN = '/auth/login';
  static const REGISTER = '/auth/register';
  static const HOME = '/home';
  static const CALENDAR = '/calendar';
  static const STORE = '/store';
  static const BAZIXUANZE = '/BaziXuanzePage';
  static const PICKERUTILS = '/PickerController';
}
